

function say() {
    alert("729. 我的日程安排表 I");
}
say();

var MyCalendar = function() {
    //12:52-05
    this.arr = []
};

/**
 * @param {number} start
 * @param {number} end
 * @return {boolean}
 */
MyCalendar.prototype.book = function(start, end) {
    var arr = this.arr
    for(var i = 0; i < arr.length; i++){
        var inArr = arr[i]
        //判断交叉:完全在内; 左交叉; 右交叉
        if(inArr[0] >= start && inArr[1] <= end){

            return false
        }else if(inArr[0] <= start && inArr[1] > start){

            return false
        }else if(end > inArr[0] && end <= inArr[1]){

            return false
        }
    }

    arr.push([start, end])
    return true
};

/**
 * Your MyCalendar object will be instantiated and called as such:
 * var obj = new MyCalendar()
 * var param_1 = obj.book(start,end)
 */
